#include "stack.h"
void StackTest1()
{
    Stack s;
    StackInit(&s);
    StackPush(&s,5);
    StackPush(&s,4);
    StackPush(&s,3);
    StackPush(&s,2);
    StackPush(&s,1);
    printf("出栈前有效元素个数为:%d\n",StackSize(&s));
    while(!StackEmpty(&s))
    {
        printf("%d ",StackTop(&s));
        StackPop(&s);
    }
    printf("\n");
    printf("出栈后有效元素个数为:%d\n",StackSize(&s));
    StackDestroy(&s);
}
void StackTest2()
{
    Stack s;
    StackInit(&s);
    StackPush(&s,1);
    printf("%d \n",StackTop(&s));
    StackDestroy(&s);
}
int main()
{
    StackTest1();
    return 0;
}
